#include<func.h>
//制造孤儿进程
int main()
{
    pid_t pid;
    pid=fork();
    if(0==pid)//孩子进程
    {
        printf("I am child,pid=%d,ppid=%d\n",getpid(),getppid());
        while(1);
        return 0;
    }
    else//父亲进程
    {
        printf("I am father,mychild=%d,pid=%d,ppid=%d\n",pid,getpid(),getppid());
        sleep(1);
        return 0;
    }
}